/**
 * Created with IntelliJ IDEA.
 * User: 卞京帅{bjslogin@gmail.com}
 * Date: 12-11-20
 * Time: 下午11:13
 * To change this template use File | Settings | File Templates.
 */
Ext.define('Airways.view.route.ConPortRightGrid' ,{
    extend: 'Ext.grid.Panel',
    alias : 'widget.conPortRightGrid',
    layout:'fit',
    autoScroll:true,
    height:'100%',
    store:'route.ExpAirPortStore',
    initComponent: function() {
        this.dockedItems = this.buildDockedItems();
        this.bbar = this.buildBbar();
        this.columns = this.buildColumns();
        this.callParent(arguments);
    },
    buildDockedItems:function(){
        return [{
            dock: 'top',
            xtype: 'toolbar',
            items:['-',{
                xtype:'label',
                text:'名称:'
            },{
                xtype:'textfield',
                name:'portName'
            },'-',{
                xtype:'label',
                text:'代码:'
            },{
                xtype:'textfield',
                name:'portCode'
            },'-']
        },{
            dock: 'top',
            xtype: 'toolbar',
            items:['-',{
                xtype:'button',
                iconCls:'find',
                text:'查询'
            },'-',{
                xtype:'button',
                iconCls:'create',
                action:'create',
                text:'新建'
            },'-',{
                xtype:'button',
                iconCls:'update',
                text:'修改',
                disable:true,
                action:'update'
            },'-',{
                xtype:'button',
                iconCls:'delete',
                text:'冻结',
                disable:true,
                action:'delete'
            },'-']
        }];
    },
    buildBbar:function(){
        return Ext.create('Ext.PagingToolbar', {
            store:'route.ExpAirPortStore',
            displayInfo: true
        });
    },
    buildColumns:function(){
        return [
            Ext.create('Ext.grid.RowNumberer'),
            {text: "港口名称",dataIndex:'portName',sortable: true,width:120},
            {text: "港口代码",dataIndex:'portCode',sortable: true,width:80},
            {text: "描述",dataIndex:'portDesc',sortable: true,flex:1}
        ];
    }
});
